package Schedule::Chronic::Distributed::TaskRequirement;

=head1 NAME

Schedule::Chronic::Distributed::Monitor::TaskRequirement - Task Requirements

=head1 SYNOPSIS

use Schedule::Chronic::Distributed::Monitor::TaskRequirement;

.. TODO..

=head1 DESCRIPTION

This package extends the Task Requirement class, providing Maypole Model actions
through inheritence.

=cut

use strict;
use base qw(Maypole::Model::CDBI::Plain Schedule::Chronic::Distributed::DBI);

__PACKAGE__->untaint_columns( integer => [qw/requirement task/], printable => ['parameters'] );

sub debug { return 1; }

sub list : Exported {
    my ( $self, $r ) = @_;
    warn "[TaskRequirement] list called with $r";
    my $order = $self->order($r);
    warn "got order\n";
    $self = $self->do_pager($r);
    warn "got pager\n";
    if ($order) {
        $r->objects( [ $self->retrieve_all_sorted_by($order) ] );
    }
    else {
        $r->objects( [ $self->retrieve_all ] );
    }
    warn "done\n";
}


1;


__END__


=head1 SEE ALSO

Schedule::Chronic::Distributed::Task

Schedule::Chronic::Distributed::Requirement

=head1 AUTHOR

aaron trevena, E<lt>aaron.trevena@gmail.comE<gt>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2006 by Aaron Trevena, Aviation Briefing Ltd

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.5 or,
at your option, any later version of Perl 5 you may have available.

=cut
